package message;

import java.io.File;
import java.util.*;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.io.File;


public abstract class AbstractMessage {
	protected String fromUser;
	protected String toUser;
	protected String message;
	protected String type;
	
	/**
	 * Constructs a message object with a single from user, the possibility of multiple 
	 * toUsers, and a single message string.
	 * @param fromUser A single string which indicates the user who is sending the message.
	 * @param toUsers An ArrayList of type String that represents the recipients of the message.
	 * @param message The string representation of the message to be sent.
	 */
	public AbstractMessage(String toUser, String fromUser, String message, String type) {
		this.fromUser = fromUser;
		this.toUser = toUser;
		this.message = message;
		this.type = type;
	}

	/**
	 * Getter function for the fromUser.
	 * @return String fromUser.
	 */
	public String getFromUser() {
		return fromUser;
	}
	
	/**
	 * Getter function for the toUsers
	 * @return ArrayList<String> of recipients.
	 */
	public String getToUser() {
		return toUser;
	}
	
	/**
	 * Getter function for the message.
	 * @return String message body.
	 */
	public String getMessage() {
		return message;
	}
	
	
	public String getType() {
		return type;
	}
	/**
	 * Getter function for the message type.
	 * @return String of the message type.
	 */
	public abstract String toHtml();
}
